<template>
  <div class="welcome-container">
    <!-- 顶部导航栏 -->
    <el-row class="header-row">
      <el-col :span="24" class="header-content">
        <div class="system-title">
          <i class="el-icon-laptop"></i>
          <span>{{ systemInfo.name }}</span>
        </div>
        <div class="user-info">
          <el-avatar :size="40" class="user-avatar">
            <img src="https://picsum.photos/id/1005/200/200" alt="用户头像">
          </el-avatar>
          <div class="user-details">
            <div class="user-name">{{ currentUser.name }}</div>
            <div class="user-role">{{ currentUser.role }}</div>
          </div>
          <el-button type="text" icon="el-icon-switch-button" class="logout-btn">退出登录</el-button>
        </div>
      </el-col>
    </el-row>

    <!-- 主要内容区域 -->
    <el-row class="main-content">
      <!-- 欢迎消息卡片 -->
      <el-col :span="24" class="welcome-card">
        <el-card shadow="hover">
          <div slot="header" class="card-header">
            <h2>欢迎回来，{{ currentUser.name }}！</h2>
            <p class="welcome-date">{{ formattedDate }}</p>
          </div>
          <div class="welcome-message">
            <p>很高兴再次见到您。今天是 {{ weekday }}，祝您工作顺利！</p>
            <p>您上次登录时间：{{ lastLoginTime }}</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>


<script>
export default {
  name: 'Index',
  data() {
    return {

    }
  },
  methods: {

  }
}

</script>


<style scoped>
.welcome-container {
  min-height: 100vh;
  background-color: #f5f7fa;
  display: flex;
  flex-direction: column;
}

/* 头部样式 */
.header-row {
  background-color: #1890ff;
  color: white;
  padding: 0 20px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.system-title {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.system-title i {
  margin-right: 10px;
  font-size: 1.8rem;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  margin-right: 15px;
}

.user-details {
  margin-right: 20px;
}

.user-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.user-role {
  font-size: 0.8rem;
  opacity: 0.9;
}

.logout-btn {
  color: white;
}

/* 主要内容区域 */
.main-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 卡片通用样式 */
.el-card {
  transition: all 0.3s ease;
}

.el-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  font-weight: bold;
}

.card-header i {
  margin-right: 8px;
  color: #1890ff;
}

/* 欢迎卡片 */
.welcome-card {
  animation: fadeIn 0.8s ease;
}

.welcome-date {
  color: #666;
  font-size: 0.9rem;
  margin-top: 5px;
}

.welcome-message {
  padding: 10px 0;
  line-height: 1.8;
  font-size: 1.1rem;
}

/* 系统信息卡片 */
.system-info-card, .system-desc-card {
  animation: fadeIn 1s ease;
}

/* 系统描述 */
.system-description {
  line-height: 1.8;
}

.system-features {
  margin-top: 15px;
}

.system-features h4 {
  margin-bottom: 10px;
  color: #1890ff;
}

.system-features .el-list-item {
  display: flex;
  align-items: center;
  line-height: 1.6;
}

.system-features i {
  color: #52c41a;
  margin-right: 8px;
}

/* 快速链接 */
.quick-links-card {
  animation: fadeIn 1.2s ease;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 0;
}

.link-button {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

/* 页脚 */
.footer-row {
  background-color: #1890ff;
  color: white;
  padding: 15px 0;
  text-align: center;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .system-info-card, .system-desc-card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .header-content {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
  }

  .user-info {
    margin-top: 15px;
  }

  .quick-links {
    flex-direction: column;
  }

  .link-button {
    width: 100%;
  }
}

</style>